// import something here

// "async" is optional;
import { Platform } from 'quasar'
// more info on params: https://quasar.dev/quasar-cli/boot-files
export default async ( { app, router, Vue  } ) => {
  const platform ={
     inMiniProgram(){
      if(window.__wxjs_environment === 'miniprogram'){
        return true
      }else{
        return false
      };
     },
     inWechat(){
      var ua = navigator.userAgent.toLowerCase();
      if (ua.match(/MicroMessenger/i) == "micromessenger" && (ua.match(/wxwork/i) != 'wxwork')) {
        return true
      }else{
        return false
      }

     },
     inDesktop(){
        if(Platform.is.desktop && !this.inMiniProgram()){
            return true
        }else{
          return false;
        }
     },
     inQw(){
      var ua = navigator.userAgent.toLowerCase();
      let isWxWork = ua.match(/WxWork/i) == "wxwork";
      if (isWxWork) {
          return true;
      } else {
          return false;
      }

     }

  }
  Vue.prototype.$platform = platform
}
